import { _decorator, Component, director} from 'cc';
const { ccclass, property } = _decorator;

@ccclass('bullet')
export class bullet extends Component {
    @property
    speed:number = 1400
    start() {
        // 攻击计时器
        console.log(director.getScene().children[0].height,"ccc")
    }

    update(deltaTime: number) {
      let pos = this.node.getPosition()
      this.node.setPosition(pos.x,pos.y+this.speed*deltaTime,pos.z)
      if(pos.y > Number(director.getScene().children[0].height)+60){
        this.node.destroy()
      }
    }
}


